// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './vuex/store'
import 'mint-ui/lib/style.css'
import '@/assets/icon/iconfont.css'
import common from '@/common/common.js'
import api from 'common/api'
import config from 'common/config'
import '@/assets/css/reset.scss'
import '@/assets/css/common.scss'
import fastclick from 'fastclick'

import '@/assets/css/animate.css'

fastclick.attach(document.body)
// Vue.use(MintUI)
Vue.config.productionTip = false

Vue.filter('money', function (value) {
  var isNum = parseFloat(value);
  if (!isNum) {
    return value;
  } else {
    var str = isNum.toString();
    var arr = str.split('.');
    var b = arr[0]
    arr[1] = arr[1] && arr[1].toString().substring(0, 2)
    var len = b.length;
    if (len <= 3) {
      return b + (arr[1] ? '.' + arr[1] : "");
    }
    var r = len % 3;
    return r > 0 ? b.slice(0, r) + "," + b.slice(r, len).match(/\d{3}/g).join(",") + (arr[1] ? '.' + arr[1] : "") : b.slice(r, len).match(/\d{3}/g).join(",") + (arr[1] ? '.' + arr[1] : "");
  }
})

Vue.filter('carName', function(item) {
   return item.carFactoryName +' ' + item.carBrandName +' ' + item.carSeriesName +' ' + item.carModelName +' ' + item.carDisplayName 
})

/* eslint-disable no-new */
// 此处判断是原生打开h5还是浏览器打开h5
new Vue({
  el: '#app',
  store,
  router,
  template: '<App/>',
  components: {
    App
  }
})
common.getfontsize()